package com.haipumi.servlets;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.haipumi.beans.JsonModel;
import com.haipumi.beans.haipumi_product;
import com.haipumi.utils.CommonData;

public class GoodsServlet extends CommonServlet {
	
	private static final long serialVersionUID = 5540900514004010367L;

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		String op=request.getParameter("op");
		if(op!=null){
			if("findAll".equals(op)){
				findAllOp(request,response);
			}
		}
	}


	private void findAllOp(HttpServletRequest request,
			HttpServletResponse response) {
		JsonModel jm=new JsonModel();
		List<haipumi_product> list=(List<haipumi_product>) request.getSession().getServletContext().getAttribute(CommonData.APPLICATIONPRODUCTKEY);
		jm.setCode(1);
		jm.setObj(list);
		super.outData(response, jm);
	}
}
